package com.invexer.common.controller.init {
import com.invexer.common.puremvc.patterns.command.InvexerSimpleCommandBase;
import com.junkbyte.console.Cc;
import com.junkbyte.console.addons.htmlexport.ConsoleHtmlExportAddon;

import org.as3commons.logging.impl.DefaultLogger;
import org.as3commons.logging.ILogger;
import org.as3commons.logging.LoggerFactory;


import org.puremvc.as3.multicore.interfaces.INotification;

public class ContextInitLogCMD extends InvexerSimpleCommandBase {
	private static var _isInited:Boolean;
	private static var logger:ILogger = LoggerFactory.getClassLogger(ContextInitLogCMD);
	override public function execute(notification:INotification):void{
		super.execute(notification);
		
		if(!_isInited){
			DefaultLogger.flashConsole = Cc;
			Cc.config.style.big();
			Cc.config.showLineNumber = true;
			Cc.config.commandLineAllowed = false;
			Cc.config.maxLines = 10000;
			Cc.config.maxRepeats = 3;
			Cc.remoting = true;
			Cc.startOnStage(notification.getBody().context.stage,  "invexer");
			ConsoleHtmlExportAddon.addToMenu("Ex");

			_isInited = true;
		}

		if(notification.getBody().callback) notification.getBody().callback();
	}
}
}
